home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / bsrc_p2.arc / KBD_ASM.ASM next >
Encoding:
Assembly Source File  |  1988-11-30  |  3.3 KB  |  115 lines

  1. .xlist
  2.         page    64,132
  3.         title   Mid-level FOSSIL Communications routines
  4.         subttl  by Wynn Wagner III
  5.         name    Com_Asm
  6.         .sall
  7. .list
  8.         if1
  9.         %out    FOSSIL routines for OPUS-Cbcs
  10.         %out    Copyright 1987. Wynn Wagner III. All Rights Reserved
  11.         endif
  12.         include version.inc
  13.         include msdos.inc
  14.         include cmacros.inc
  15.         if2
  16.         if memS ne 1
  17.         if memM ne 1
  18.         error   <You have to use SMALL data memory for this module.>
  19.         endif
  20.         endif
  21.         endif
  22.  
  23.  
  24.  
  25.  
  26. sBegin   code
  27.  
  28.          assumes  cs,code
  29.          assumes  ds,data
  30.  
  31.  
  32.           page
  33.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  34.          ;;                                          ;;
  35.          ;; ROUTINE: _readkb                         ;;
  36.          ;;                                          ;;
  37.          ;; PURPOSE: Get keyboard stuff from DOS     ;;
  38.          ;;                                          ;;
  39.          ;; USAGE:   int readkb(void);               ;;
  40.          ;;                                          ;;
  41.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  42.  
  43. cProc    readkb,<PUBLIC>
  44.  
  45. cBegin
  46.  
  47.          callos   coninput
  48.          xor      ah, ah
  49.  
  50. cEnd
  51.  
  52.  
  53. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  54.  
  55.          page
  56.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  57.          ;;                                          ;;
  58.          ;; ROUTINE: _kpress                         ;;
  59.          ;;                                          ;;
  60.          ;; PURPOSE: Returns non-zero if a character ;;
  61.          ;;          is available in the keyboard    ;;
  62.          ;;          buffer.                         ;;
  63.          ;;                                          ;;
  64.          ;; USAGE:   int kpress(void);               ;;
  65.          ;;                                          ;;
  66.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  67.  
  68. cProc    kpress,<PUBLIC>
  69.  
  70. cBegin
  71.  
  72.          callos   kbdstatus
  73.          xor      ah, ah
  74.  
  75. cEnd
  76.  
  77.  
  78. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  79.  
  80.          page
  81.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  82.          ;;                                          ;;
  83.          ;; ROUTINE: _rdscan                         ;;
  84.          ;;                                          ;;
  85.          ;; PURPOSE: Returns non-zero if a character ;;
  86.          ;;          is available in the keyboard    ;;
  87.          ;;          buffer.                         ;;
  88.          ;;                                          ;;
  89.          ;; USAGE:   int kpress(void);               ;;
  90.          ;;                                          ;;
  91.          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  92.  
  93. cProc    rdscan,<PUBLIC>,<si,di>
  94.  
  95. cBegin
  96.          callos   coninput
  97.          xor      ah, ah
  98.  
  99.          or       al, al            ; is it 0? (extended scan code?)
  100.          jne      Done              ; no, just return the value
  101.  
  102.          callos   coninput          ; get second character of extended code
  103.          xor      ah, ah
  104.  
  105.          mov      cl, 8             ; make it look like an extended code
  106.          shl      ax, cl
  107. Done:
  108.  
  109. cEnd
  110.  
  111.  
  112.  
  113. sEnd
  114.          end
  115.